# 猜拳游戏
# 需求电脑随机出 1 2 3 1代表剪刀 2代表石头 3代表布
# 要求玩家随机输入 1 2 3
# 1.电脑赢  2.玩家赢  3.打平

# import random
# pc =  random.randint(1,3) #电脑随机从1-3选出数字 包括1和3
# player = int(input('请输入数字:'))
# if (pc == 1 and player == 2) or (pc == 2 and player == 3) or (pc == 3 and player == 1):  #玩家获胜
#     print(f'电脑出了{pc},我出了{player},我赢了')
# elif(pc == player):
#     print('平局')
# else:
#     print(f'电脑出了{pc},我出了{player},电脑赢了')
#



   # 改良版  将数字改成字符
import random
pc = random.randint(1, 3)  # 电脑随机从1-3选出数字 包括1和3
a= None
if pc == 1:
    a="剪刀"
elif pc == 2:
    a='石头'
else:
    a='布'
player = input('请输入石头剪刀布:')
if (a == "剪刀" and player == '石头') or (a == '石头' and player == '布') or (a == '布' and player == "剪刀"):  # 玩家获胜
    print(f'电脑出了{a},我出了{player},我赢了')
elif (a == player):
    print('平局')
else:
    print(f'电脑出了{a},我出了{player},电脑赢了')

#
#
#
#



























